<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>课程管理</title>

 <style>
        h1 {
            font-size: 30px;
            
            text-transform: uppercase;
            font-weight: 300;
            text-align: center;
            margin-bottom: 15px;
        }
        table {
            width: 100%;
            table-layout: fixed;
        }
        .tbl-header {
            background-color: rgba(255,255,255,0.3);
        }
        .tbl-content {
            height: 300px;
            overflow-x: auto;
            margin-top: 0px;
            border: 1px solid rgba(255,255,255,0.3);
        }
        th {
            padding: 20px 15px;
            text-align: left;
            font-weight: 500;
            font-size: 12px;
           
            text-transform: uppercase;
        }
        td {
            padding: 15px;
            text-align: left;
            vertical-align: middle;
            font-weight: 300;
            font-size: 12px;
            color: #fff;
            border-bottom: solid 1px rgba(255,255,255,0.1);
        }
    </style>
<style type="text/css">
  td,th{
    padding:8px 15px;
    text-align:center;
  }
</style>



<script type="text/javascript">
   function del(id) {
	if(confirm("是否要删除记录")){
		window.location="course?method=delete&id="+id;
	}
}
   function add() {
	window.location="course?method=add"
}

</script>

<style type="text/css">
 .contrainer{
   width:800px;
   margin:20px auto
 }
  .contrainer h3{
    text-align:center;
  }
  table{
    width:100%; 
    border-collapse:collapse;
  }
  td,th{
    padding:8px 15px;
    text-align:center;
  }
</style>
</head>
<body background="images/1.jpg">

  <h1>课程管理</h1>
   

<div class="contrainer">
 <button type="button" onclick="add()">新增</button>
 
 
   <table class="tbl-header">
     <tr> 
       <th>序号</th>
       <th>课程名称</th>
       <th>学时</th>
       <th colspan="2">操作</th>
     </tr>
     <c:forEach items="${list}" var="kc">
      <tr>
        <td>${kc.id}</td>
        <td>${kc.name}</td>
        <td>${kc.classHour}</td>
        <td><a href="course?method=update&id=${kc.id}">修改</a></td>
         <td><a href="javascript:del(${kc.id})">删除</a></td>
      </tr>
     </c:forEach>
   </table>
  
   
    <a href=main.jsp>返回首页</a>
    </div>
</body>
</html>